#ifndef ZYGTIMER_H
#define ZYGTIMER_H

#define HOUR_TO_SECOND 60 * 60
#define MINUTE_TO_SECOND  60

#include <QDir>
#include <QTime>
#include <QFile>
#include <QTimer>
#include <QDebug>
#include <QString>

#include "tools.h"
#include "zygplayer.h"
#include "zygcycliclinkedlist.hpp"

#define DEFAULT_SOUND_FILE_PATH "qrc:/resource/sounds/zyg_come_or_go_off_work.mp3";

class ZygTimer :public QObject
{
    Q_OBJECT
public:
    ZygTimer();
    ~ZygTimer();

    void setHour(int hour);
    int getHour();
    QString getHourString();
    void setMinute(int minute);
    int getMinute();
    QString getMinuteString();
    void setSecond(int second);
    int getSecond();
    QString getSecondString();
    void setSoundFilePath(QString soundFilePath);
    QString getSoundFilePath();
    QString toTimeString();
    QString toString();
    QString toFormatString();
    void print();
    void createAlarmClock();

    static void printList();
    static bool addTimer(ZygTimer* t);
    static void deleteTimer(int i);
    static int listSize();
    static void clearList();
    static ZygTimer* get(int index);
    static QString listToFormatString();

    bool operator<(ZygTimer* other);
    bool operator>(ZygTimer* other);
    bool operator== (ZygTimer* other);




private:
    int hour;
    int minute;
    int second;
    QTimer* alarmClock;
    QString soundFilePath;
    QString soundFileName;
    static ZygClicLinkedList<ZygTimer>* timerList;
    QString getFileName();

};

#endif // ZYGTIMER_H
